<!--
 * @Author: your name
 * @Date: 2021-08-16 17:40:41
 * @LastEditTime: 2021-08-16 21:38:30
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \orderSystems\src\views\menuMag\search.vue
-->
<template>
  <!-- 搜索组件 -->
  <div id="search">
    <div class="search-container">
      <div class="search-title">查询</div>
      <el-form :inline="true" :model="formInline" class="form-search">
        <el-form-item label="搜索：" class="search-item">
          <el-input v-model="formInline.search" :placeholder="nowView"></el-input>
        </el-form-item>
        <el-form-item class="search-item">
          <el-button type="success" icon="el-icon-search" @click="onSearch">查询</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  props:['nowView'],
  data() {
    return {
      formInline: {
        search: "",//要搜索的内容
        // serachWhat:this.$route.params.placeholderName
      }
      
    };
  },
  methods:{
      //点击搜索的函数
      onSearch(){
          
          console.log('当前接口',this.nowView)
          this.$emit('searchWhat',this.formInline.search)
      }
  },
 
  
  
};
</script>

<style lang='less' scoped>
.search-container {
  background-color: #fff;
//   height: 8rem;
  border: 0.1rem solid #dbe0e9;
  .search-title {
    height: 4rem;
    background-color: #f2f2f2;
    box-sizing: border-box;
    border-bottom: 0.1rem solid #dbe0e9;
    line-height: 4rem;
    font-size: 1.4rem;
    padding-left: 3rem;
    font-weight: 500;
    color: #666666;
  }
  .form-search{
      margin:1rem ;
      padding: 1.5rem;
      background-color: #F5F9FC;
      box-sizing: border-box;
      .search-item{
          margin-bottom: 0;
      }
  }
}
</style>